﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Emgu.CV.Structure;
using Emgu.CV;

namespace ThreeDI.IP
{
    public class TrackingInfo
    {
        #region [Members]

        Rectangle _Face;      //, _LeftEye, _RightEye;
        double _headDistance;
        // public Image<Bgr, Byte> _Frame;   //should be removed

        #endregion

        #region [Properties]

        public Rectangle FaceRectangle
        {
            get
            {
                return _Face;
            }
            set
            {
                _Face = value;
                Center = new Point(((_Face.Location.X + _Face.Width / 2) - 160) * -1, (_Face.Y + _Face.Height / 2) - 120);
                HasFace = true;
            }
        }
        public Point Center { get; set; }
        public double XAngle { get; set; }
        public double YAngle { get; set; }
        public double HeadDistance
        {
            get
            {
                return _headDistance;
            }
            set
            {
                _headDistance = value;

                XAngle = Math.Tan(Center.X / HeadDistance);
                XAngle = Math.Atan(XAngle) * 100;

                YAngle = Math.Tan(Center.Y / HeadDistance);
                YAngle = Math.Atan(YAngle) * 100;
            }
        }
        public bool HasFace { get; private set; }

        #endregion

        #region [Constructor]

        public TrackingInfo()
        {
            HasFace = false;

            /////////////////////////
            //    RR        LL     //
            //    RR        LL     //
            //                     //
            //         n           //
            //         n           //
            /////////////////////////
        }

        #endregion
    }
}
